home *** CD-ROM | disk | FTP | other *** search
/ HTBasic 9.3 / HTBasic 9.3.iso / 93win / data1.cab / Basic_Plus_Examples / NBRWDGT < prev    next >
Encoding:
Text File  |  2005-03-02  |  1.5 KB  |  37 lines

  1. 10    ! **********************************************************
  2. 20    ! Example: NUMBER Widget
  3. 30    !
  4. 40    ! This program creates a NUMBER widget. You can enter
  5. 50    ! a number from 0 through 1000 from the keyboard. When you
  6. 60    ! you press Enter, the number entered is displayed on the
  7. 70    ! screen. If you attempt to enter a number greater than
  8. 80    ! 1000, an error is generated and the previously-entered
  9. 90    ! number is displayed.
  10. 100   !
  11. 110    ! **********************************************************
  12. 120   !
  13. 130       ASSIGN @Number TO WIDGET "NUMBER";SET ("REAL NOTATION":"FIXED")
  14. 140       CONTROL @Number;SET ("TITLE":" Example: NUMBER Widget")
  15. 150       CONTROL @Number;SET ("X":50,"Y":25,"WIDTH":250)
  16. 160       CONTROL @Number;SET ("MINIMUM":0,"MAXIMUM":1000)
  17. 170       CONTROL @Number;SET ("CHECK FOR DONE":1)
  18. 180       CONTROL @Number;SET ("SYSTEM MENU":"Quit")
  19. 190   !
  20. 200       ON EVENT @Number,"SYSTEM MENU" GOTO Finis
  21. 210       ON EVENT @Number,"RETURN" GOSUB Get_number
  22. 220       ON EVENT @Number,"DONE" GOSUB Get_number
  23. 230       LOOP
  24. 240           WAIT FOR EVENT
  25. 250       END LOOP
  26. 260  Get_number:!
  27. 270       STATUS @Number;RETURN ("MODIFIED":New_number,"VALUE":Value)
  28. 280       IF New_number THEN
  29. 290           DISP "New number: ";Value
  30. 300           CONTROL @Number;SET ("MODIFIED":0)
  31. 310       END IF
  32. 320       RETURN
  33. 330   !
  34. 340  Finis:!
  35. 350       ASSIGN @Number TO * ! Delete NUMBER widget
  36. 360       END
  37.